#include<stdlib.h>
#include<stdio.h>
int masv[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
int masnv[13] = {0,31,29,31,30,31,30,31,31,30,31,30,31};
int s,i,d,m,y,j,u;
void proverka(d,m,y)
{
	if(d>31 || d<0) {printf("data neverna"); exit(1);}
	if(m>12 || d<0) {printf("mesyac neveren"); exit(1);}
	if(y<1800){ printf ("na etot god net scheta"); }
	if(y>2021){ printf("po prognozam eto ocherednoi konec sveta\n"); }
}
int poisk(d,m,y)
{    
	s=1;
	if(y%4==0 && y%400==0 && y%400==0) 
			{ 
				for(i=1;i<=m-1;i++) 
				{
					s=s+masv[i];
					s=s+d;
				}
		}
		else 
			for(i=1;i<=m-1;i++) 
				{
					s=s+masnv[i];
					s=s+d;
				}
	
return s;
}
void body ()
{	

	printf("nomer dnya= %d\n",poisk(d,m,y));
}
void main ()
{
	printf("vvedite datu\n");
	scanf("%d", &d);
	printf("spasibo,vvedite teper mesyac\n");
	scanf("%d", &m);
	printf("spasibo,vvedite teper god\n");
	scanf("%d", &y);
	proverka(d,m,y);
	body();
	system("pause");

}